<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>呼入统计</title>
    <meta name="decorator" content="default"/>
    <style>
    </style>
</head>
<body>
    <%--<ul class="nav nav-tabs">
        <li class="active"><a href="${ctx}/call/reoprt/callReportIn/">呼入统计</a></li>
    </ul>--%>
    <form:form style="min-width: 100%;" id="searchForm" modelAttribute="callReportInQuery" action="${ctx}/call/reoprt/callReportIn/" method="post"
               class="breadcrumb form-search">
        <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
        <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
        <ul class="ul-form">
            <ul class="ul-form">
                <li>
                    <div class="input-prepend">
                        <span class="add-on">开始时间</span>
                        <form:input readonly="true" path="beginDate" type="text" class="input-medium"
                                    onmousedown="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
                    </div>
                    <div class="input-prepend">
                        <span class="add-on">结束时间</span>
                        <form:input readonly="true" path="endDate" type="text" class="input-medium"
                                    onmousedown="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
                    </div>
                    <div class="input-prepend">
                        <span class="add-on">统计范围</span>
                        <form:select path="statType" cssClass="select-medium">
                            <form:option value="1">全&nbsp;&nbsp;&nbsp;&nbsp;天</form:option>
                            <form:option value="2">上班时段</form:option>
                        </form:select>
                    </div>
                </li>
                <li class="btns">
                </li>
                <li class="clearfix"></li>
            </ul>
            <ul class="ul-form">
                <li>
                <div class="input-prepend">
                    <span class="add-on">&nbsp;&nbsp;工&nbsp;&nbsp;&nbsp;号&nbsp;&nbsp;</span>
                    <form:input path="callingId" cssClass="input-medium" type="text" class="input-medium" />
                </div>
                <c:if test="${not empty fns:getDictList('CALL_CONFIG_OFFICE_IN')}">
                    <div class="input-prepend">
                        <span class="add-on">&nbsp;&nbsp;部&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;</span>
                        <form:select path="officeId" cssClass="select-medium">
                            <form:option value="">全部</form:option>
                            <c:forEach items="${fns:getDictList('CALL_CONFIG_OFFICE_IN')}" var="office">
                                <form:option value="${office.value}">${office}</form:option>
                            </c:forEach>
                        </form:select>
                    </div>
                </c:if>
                </li>
                <li class="btns">
                    <button class="btn btn-small btn-primary" type="button" onclick="return page(1);">
                        查询<span class="icon-search icon-white"></span>
                    </button>
                    <button id="export" class="btn btn-small btn-primary" type="button">
                        导出<span class="icon-share-alt icon-white"></span>
                    </button>
                </li>
                <li class="clearfix"></li>
            </ul>
        </ul>
    </form:form>
    <sys:message content="${message}"/>
    <table id="contentTable" style="min-width: 1100px;" class="table table-striped table-bordered table-condensed table-hover static-table">
        <thead>
        <tr>
            <th style="width: 20px;">序号</th>
            <th>工号</th>
            <th style="min-width: 50px;">姓名</th>
            <th>部门</th>
            <th>请求呼入量</th>
            <th>呼入接起量</th>
            <th>呼入接起率</th>
            <th>总通话时长</th>
            <th>平均通话时长</th>
            <th>应答时长</th>
            <th>平均应答时长</th>
            <th>振铃时长</th>
            <th>振铃次数</th>
            <th>平均振铃时长</th>
            <th>最长通话</th>
            <th>示忙时长</th>
            <th>示闲时长</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.list}" var="callReportIn" varStatus="count">
            <tr class="list">
                <td style="text-align: center;">${count.count}</td>
                <td title="统计日期:<fmt:formatDate value="${callReportIn.createDate}" pattern="yyyy-MM-dd"/>至<fmt:formatDate value="${callReportIn.statDate}" pattern="yyyy-MM-dd"/>">${fn:substring(callReportIn.callingId, 12,21)}</td>
                <td>${callReportIn.userName}</td>
                <td>${callReportIn.office.name}</td>
                <td title="客户挂机${callReportIn.CCalled}次,坐席挂机${callReportIn.SCalled}">${callReportIn.callCount}</td>
                <td>${callReportIn.successCallCount}</td>
                <td><fmt:formatNumber value="${callReportIn.successCallRate}" pattern="##.###%"/></td>
                <td title="${callReportIn.callTime}秒">${fns:toTimeString(callReportIn.callTime)}</td>
                <td title="${callReportIn.callTimeAvg}秒">${fns:toTimeString(callReportIn.callTimeAvg)}</td>
                <td title="${callReportIn.successCallTime}秒">${fns:toTimeString(callReportIn.successCallTime)}</td>
                <td title="${callReportIn.successCallTimeAvg}秒">${fns:toTimeString(callReportIn.successCallTimeAvg)}</td>
                <td title="${callReportIn.ringTime}秒">${fns:toTimeString(callReportIn.ringTime)}</td>
                <td>${callReportIn.ringCount}</td>
                <td title="${callReportIn.ringAvgTime}秒">${fns:toTimeString(callReportIn.ringAvgTime)}</td>
                <td title="${callReportIn.callMaxTime}秒">${fns:toTimeString(callReportIn.callMaxTime)}</td>
                <td title="${callReportIn.busyTime}秒">${fns:toTimeString(callReportIn.busyTime)}</td>
                <td title="${callReportIn.freeTime}秒">${fns:toTimeString(callReportIn.freeTime)}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div class="pagination">${page}</div>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#export").click(function(){
                loading('正在导出，请稍等...');
                var form = $("#searchForm");
                var parm =  form.serialize();
                var action = form.attr("action");
                var exportURL = action + 'export?'+parm;
                location.href = exportURL;
                setTimeout(function(){
                    closeTip();
                }, 3000);
            });
        });
        function page(n, s) {
            loading('正在查询，请稍等...');
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</body>
</html>